// stores/teamStore.ts
import { defineStore } from 'pinia'

export const useTeamStore = defineStore('team', {
  state: () => ({
    teamDetails: {
      id: 0,
      teamName: '',
      description: '',
      logo: '',
      tag: '',
      maxCount: 0,
      subscribePrice: 0,
      subscribeCycle: 0,
      subscribeDiscount: 0,
      trialDays: 0,
      createTime: '',
    }
  }),
  actions: {
    setTeamDetails(data: any) {
      Object.assign(this.teamDetails, data)
    },
    resetTeamDetails() {
      this.setTeamDetails({
        id: 0,
        teamName: '',
        description: '',
        logo: '',
        tag: '',
        maxCount: 0,
        subscribePrice: 0,
        subscribeCycle: 0,
        subscribeDiscount: 0,
        trialDays: 0,
        createTime: '',
      })
    }
  }
})
